<!DOCTYPE html>
<html>
    <head>
       <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta charset="utf-8" />
		<title>驴妈妈流立方</title>
		<meta name="description" content="overview &amp; stats" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
		<!-- bootstrap & fontawesome -->
		<link rel="stylesheet" href="${rc.contextPath}/assets/css/bootstrap.min.css" />
		<link rel="stylesheet" href="${rc.contextPath}/stylesheets/bootstrap.min.css">
		<link rel="stylesheet" href="${rc.contextPath}/stylesheets/bootstrap-theme.min.css">
		<link rel="stylesheet" href="${rc.contextPath}/assets/font-awesome/4.5.0/css/font-awesome.min.css" />
		<!-- page specific plugin styles -->
		<link rel="stylesheet" href="${rc.contextPath}/assets/css/jquery.gritter.min.css" />
		<!-- text fonts -->
		<link rel="stylesheet" href="${rc.contextPath}/assets/css/fonts.googleapis.com.css" />
		<!-- ace styles -->
		<link rel="stylesheet" href="${rc.contextPath}/assets/css/ace.min.css" class="ace-main-stylesheet" id="main-ace-style" />
		<link rel="stylesheet" href="${rc.contextPath}/assets/css/ace-skins.min.css" />
		<link rel="stylesheet" href="${rc.contextPath}/assets/css/ace-rtl.min.css" />
		
		<link rel="stylesheet" href="${rc.contextPath}/stylesheets/daterangepicker.css">
    </head>
    <body class="skin-2" style="background-color: #FFF;">
		<div class="page-content">
			<!-- <div class="page-header">
				<h1>
					昨日数据
				</h1>
			</div> -->
			<div class="row">
				<div class="col-sm-12">
					<div class="row">
						<div class="col-sm-4">
							<div id="main" style="width:100%;height:600px;margin:0 auto;"></div>
						</div>
						<div class="col-sm-8">
							<div id="container2" style="width:100%;height:50%; margin: 0 auto; "></div>
							<div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
								<div class="row">
									<form class="form-inline" id="searchForm" method="post" action="${rc.contextPath}/push/exportData">
										<div class="form-group">
											<label for="exampleInputName2">选择时段</label>
											<input class="form-control" type="text" id="chooseTime" name="chooseTimeVO"/>
										</div>
										<div class="form-group">
											<button  type="button"  class="btn btn-pink btn-sm" id="query">
												<span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
												查询(全国)
											</button>
											<span>温馨提示:省份查询请点击地图</span>
										</div>
									</form>
								</div>
								<table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer" role="grid" aria-describedby="dynamic-table_info">
									<thead>
										<tr>
											<th>地区</th>
											<th>在线客户问答次数</th>
											<th>按钮点击次数</th>
											<th>常见问题</th>
											<th>智能客服页面打开次数</th>
											<th>来源页面统计</th>
											<th>日期</th>
										</tr>
									</thead>
									<tbody>
										<tr id="data">
										</tr>
									</tbody>
								</table>
							</div>
						</div>
						<!-- <div class="col-sm-3">
							<div id="container2" style="width:100%;height:50%; margin: 0 auto; "></div>
						</div> -->
					</div>
				</div>
			</div>
		</div>
		<script src="${rc.contextPath}/assets/js/jquery-2.1.4.min.js"></script>
		<script type="text/javascript">
			if('ontouchstart' in document.documentElement) document.write("<script src='${rc.contextPath}/assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
		</script>
		<script src="${rc.contextPath}/assets/js/bootstrap.min.js"></script>

		<!-- page specific plugin scripts -->
		<script type="text/javascript" src="${rc.contextPath}/javascripts/moment.js"></script>
	   	<script type="text/javascript" src="${rc.contextPath}/javascripts/daterangepicker.js"></script>
		<script type="text/javascript" src="${rc.contextPath}/javascripts/echarts.js"></script>
		<script type="text/javascript" src="${rc.contextPath}/javascripts/china.js"></script>
		<!-- ace scripts -->
		<script src="${rc.contextPath}/assets/js/jquery.gritter.min.js"></script>
		<script src="${rc.contextPath}/assets/js/ace-elements.min.js"></script>
		<script src="${rc.contextPath}/assets/js/ace.min.js"></script>
		<script type="text/javascript">
    	      function randomData() {
    	    	    return Math.round(Math.random()*100);
    	    	}
    	      option = {
    	    		    title: {
    	    		        text: '客服机器人',
    	    		        subtext: '',
    	    		        left: 'center'
    	    		    },
    	    		    tooltip: {
    	    		        trigger: 'item',
    	    		        show:false
    	    		    },
    	    		    grid : {
    	    		    	width: '100%',
    	    		    	height: '100%'
    	    		    },
    	    		   /*  legend: {
    	    		        orient: 'vertical',
    	    		        left: 'left',
    	    		        data:['客服机器人']
    	    		    }, */
    	    		    visualMap: {
    	    		        min: randomData(),
    	    		        max: 2500,
    	    		        left: 'left',
    	    		        top: 'bottom',
    	    		        text: [],           // 文本，默认为数值文本
    	    		        calculable: true,
    	    		        show:false
    	    		    }, 
    	    		 
    	    		    series: [
    	    		        {
    	    		            name: '客服机器人统计',
    	    		            type: 'map',
    	    		            mapType: 'china',
    	    		            roam: false,
    	    		            zoom: 1.25,
    	    		            label: {
    	    		                normal: {
    	    		                    show: true
    	    		                },
    	    		                emphasis: {
    	    		                    show: true
    	    		                }
    	    		            },
    	    		            data:[
    	    		                  {name: '北京',value: randomData() },
    	    		                  {name: '天津',value: randomData() },
    	    		                  {name: '上海',value: randomData() },
    	    		                  {name: '重庆',value: randomData() },
    	    		                  {name: '河北',value: randomData() },
    	    		                  {name: '河南',value: randomData() },
    	    		                  {name: '云南',value: randomData() },
    	    		                  {name: '辽宁',value: randomData() },
    	    		                  {name: '黑龙江',value: randomData() },
    	    		                  {name: '湖南',value: randomData() },
    	    		                  {name: '安徽',value: randomData() },
    	    		                  {name: '山东',value: randomData() },
    	    		                  {name: '新疆',value: randomData() },
    	    		                  {name: '江苏',value: randomData() },
    	    		                  {name: '浙江',value: randomData() },
    	    		                  {name: '江西',value: randomData() },
    	    		                  {name: '湖北',value: randomData() },
    	    		                  {name: '广西',value: randomData() },
    	    		                  {name: '甘肃',value: randomData() },
    	    		                  {name: '山西',value: randomData() },
    	    		                  {name: '内蒙古',value: randomData() },
    	    		                  {name: '陕西',value: randomData() },
    	    		                  {name: '吉林',value: randomData() },
    	    		                  {name: '福建',value: randomData() },
    	    		                  {name: '贵州',value: randomData() },
    	    		                  {name: '广东',value: randomData() },
    	    		                  {name: '青海',value: randomData() },
    	    		                  {name: '西藏',value: randomData() },
    	    		                  {name: '四川',value: randomData() },
    	    		                  {name: '宁夏',value: randomData() },
    	    		                  {name: '海南',value: randomData() },
    	    		                  {name: '台湾',value: randomData() },
    	    		                  {name: '香港',value: randomData() },
    	    		                  {name: '澳门',value: randomData() }
    	    		              ]
    	    		        },
    	    		    ]
    	    		};
    	    	jQuery(function($) {
					$('#chooseTime').daterangepicker({
						startDate: new Date(new Date().getTime()-1*1000*60*60*24),
					    endDate: new Date(new Date().getTime()-1*1000*60*60*24),
						/* startDate: new Date(new Date().getTime()-7*1000*60*60*24),
					    endDate: new Date(new Date().getTime()-1*1000*60*60*24), */
					    showDropdowns : true,  
			            showWeekNumbers : false,
			            timePicker : false,
			            timePicker12Hour : false,
			            ranges : {  
			            	'昨日': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
			            	'最近7日': [moment().subtract(7, 'days'), moment().subtract(1, 'days')],  
			                '最近30日': [moment().subtract(30, 'days'), moment().subtract(1, 'days')],
			                '最近90日': [moment().subtract(90, 'days'), moment().subtract(1, 'days')]
			            },
			            opens : 'right',  
			            buttonClasses : [ 'btn btn-default' ],  
			            applyClass : 'btn-small btn-pink',  
			            cancelClass : 'btn-small',  
			            format : 'yyyy-MM-dd',
			            separator : ' to ',
			            locale : {  
			                applyLabel : '确定',  
			                cancelLabel : '取消',  
			                fromLabel : '起始时间',  
			                toLabel : '结束时间',  
			                customRangeLabel : '自定义',  
			                daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],  
			                monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月',  
			                        '七月', '八月', '九月', '十月', '十一月', '十二月' ],  
			                firstDay : 1  
			            }
					},
					function(start, end, label) {//格式化日期显示框  
			            
			            $('#chooseTime').html(start.format('yyyy-MM-dd') + ' - ' + end.format('yyyy-MM-dd'));  
			       });
				});
    	    		
    	    	Date.prototype.format =function(format){
				   var o = {
				   "M+" : this.getMonth()+1, //month
				   "d+" : this.getDate(), //day
				   "h+" : this.getHours(), //hour
				   "m+" : this.getMinutes(), //minute
				   "s+" : this.getSeconds(), //second
				   "q+" : Math.floor((this.getMonth()+3)/3), //quarter
				   "S" : this.getMilliseconds() //millisecond
				   }
				   if(/(y+)/.test(format)) format=format.replace(RegExp.$1,
				   (this.getFullYear()+"").substr(4- RegExp.$1.length));
				   for(var k in o)if(new RegExp("("+ k +")").test(format))
				   format = format.replace(RegExp.$1,
				   RegExp.$1.length==1? o[k] :
				   ("00"+ o[k]).substr((""+ o[k]).length));
				   return format;
				}
    	      	$(function(){
    	    	  var ms=new Date().getTime();
    	    	  var now = new Date(ms-24*60*60*1000).format("MM/dd/yyyy");
    	    	  var chooseTimeAll = now+" - "+ now;
    	    	  var myChart = echarts.init(document.getElementById('main'));
    	    	  myChart.setOption(option);
    	    	  
    	    	  $.ajax({
    	    		   url: "${rc.contextPath}/robot/ajaxData",
    	    		   data: {
	    				   province:"全国",
	    				   chooseTime:chooseTimeAll
	    			   },
    	    		   success: function(data){
   	    			   			var html="<td>"+data.area+"</td>";
   	    			   			var html1="";
   	    			   			if(data.askAnswerStat != null){
				    	       		html1+=data.askAnswerStat.counts;
   	    			   			}
   	    			   			
   	    			   			html+="<td>"+html1+"</td>";
   	    			   			
				    	       	var html2="";
					    	     if(data.buttonList!=null && data.buttonList.length!=0){
					    	      for(var i=0;i<data.buttonList.length;i++){
					    	    	  html2+=data.buttonList[i].name+"&nbsp;&nbsp;&nbsp;"+data.buttonList[i].counts+"次"+"<br/><br/>";
					    	      }
					    	     }
					    	      html+="<td>"+html2+"</td>";
					    	      
					    	      var html3="";
					    	      if(data.questionList !=null && data.questionList.length != 0){
					    	      for(var i=0;i<data.questionList.length;i++){
					    	    	  html3+=data.questionList[i].name+"&nbsp;&nbsp;&nbsp;"+data.questionList[i].counts+"次"+"<br/><br/>";
					    	      }
					    	      }
					    	      html=html+"<td>"+html3+"</td>";
					    	      
					    	      
					    	      
					    	      var html4="";
					    	      if(data.pageVisitList!=null && data.pageVisitList.length!=0){
					    	      for(var i=0;i<data.pageVisitList.length;i++){
					    	    	  html4+=data.pageVisitList[i].name+"&nbsp;&nbsp;&nbsp;"+data.pageVisitList[i].counts+"次"+"<br/><br/>";
					    	      }
					    	      }
					    	      html=html+"<td>"+html4+"</td>";
					    	      
					    	      var html5="";
					    	      if(data.sourceVisitList!=null && data.sourceVisitList.length!=0){
					    	      for(var i=0;i<data.sourceVisitList.length;i++){
					    	    	  html5+=data.sourceVisitList[i].name+"&nbsp;&nbsp;&nbsp;"+data.sourceVisitList[i].counts+"次"+"<br/><br/>";
					    	      }
					    	      }
					    	      html=html+"<td>"+html5+"</td>";
					    	      
					    	      
					    	      var start=new Date(data.startDate).format('yyyy-MM-dd');
 					    	      var end=new Date(data.endDate).format('yyyy-MM-dd');
 					    	      if(start == end){
 					    	    	 html=html+"<td>"+new Date(data.startDate).format('yyyy-MM-dd')+"</td>";
 					    	      }else{
 					    	    	 html=html+"<td >"+new Date(data.startDate).format('yyyy-MM-dd')+"至"+"<br>"+new Date(data.endDate).format('yyyy-MM-dd')+"</td>";
 					    	      }
					    	      $("#data").append(html);
					    	      var data1=data.buttonPie;
					    	      var data2=data.questionPie;
					    	      option1 = {
					    	    		    title : {
					    	    		        text: '按钮点击次数',
					    	    		        x:'center'
					    	    		    },
					    	    		    grid : {
					    	    		    	width: '100%',
					    	    		    	height: '100%'
					    	    		    },
					    	    		    tooltip : {
					    	    		        trigger: 'item',
					    	    		        formatter: "{a} <br/>{b} : {c} ({d}%)"
					    	    		    },
					    	    		    series : [
					    	    		        {
					    	    		           /*  name: '访问来源', */
					    	    		            type: 'pie',
					    	    		            radius : '55%',
					    	    		            center: ['50%', '60%'],
					    	    		            data:data1,
					    	    		            itemStyle: {
					    	    		                emphasis: {
					    	    		                    shadowBlur: 10,
					    	    		                    shadowOffsetX: 0,
					    	    		                    shadowColor: 'rgba(0, 0, 0, 0.5)'
					    	    		                }
					    	    		            }
					    	    		        }
					    	    		    ]
					    	    		};
					    	      
					    	      
					    	      option2 = {
					  	    		    title : {
					  	    		        text: '常见问题',
					  	    		        x:'center'
					  	    		    },
					  	    		    tooltip : {
					  	    		        trigger: 'item',
					  	    		        formatter: "{a} <br/>{b} : {c} ({d}%)"
					  	    		    },
					  	    		  	grid : {
				    	    		    	width: '100%',
				    	    		    	height: '100%'
				    	    		    },
					  	    		    series : [
					  	    		        {
					  	    		           /*  name: '访问来源', */
					  	    		            type: 'pie',
					  	    		            radius : '55%',
					  	    		            center: ['50%', '60%'],
					  	    		            data:data2,
					  	    		            itemStyle: {
					  	    		                emphasis: {
					  	    		                    shadowBlur: 10,
					  	    		                    shadowOffsetX: 0,
					  	    		                    shadowColor: 'rgba(0, 0, 0, 0.5)'
					  	    		                }
					  	    		            }
					  	    		        }
					  	    		    ]
					  	    		};
					    	      var divhtml="<div class='right' id='main1' style='float:left;width:50%;height:300px;left:0 auto'></div><div class='right' id='main2' style='float:left;width:50%;height:300px;left:0 auto'></div>";
					    	      $("#container2").append(divhtml);
					    	      if(data.buttonPie !=null && data.buttonPie.length !=0){
					    	      var myChart1 = echarts.init(document.getElementById('main1'));
				    	    	  myChart1.setOption(option1);
					    	      }
					    	      if(data.questionPie !=null && data.questionPie.length !=0){
				    	    	  var myChart2 = echarts.init(document.getElementById('main2'));
				    	    	  myChart2.setOption(option2);
				    	    	  
					    	      }
					    	      window.onresize = function(){
				    	    		  myChart.resize();
				    	    		  myChart1.resize();
				    	    		  myChart2.resize();
							  	  }
    	    		   }
    	    		});
    	    	  
    	    	  myChart.on('click', function (params) {
    	    		  var chooseTime=$("#chooseTime").val();
    	    		  $.ajax({
    	    			   url: "${rc.contextPath}/robot/ajaxData",
    	    			   data: {
    	    				   province:params.name,
    	    				   chooseTime:chooseTime
    	    			   },
    	    			   success: function(data){
    	    				   var data1=data.buttonPie;
			    	      		var data2=data.questionPie;
      	    		  				$("#data").empty();
      	    		  			 	$("#container2").empty();
    	    					var html="<td >"+data.area+"</td>";
	    			   			var html1="";
	    			   			if(data.askAnswerStat != null){
				    	       		html1+=data.askAnswerStat.counts;
	    			   			}
	    			   			
	    			   			html+="<td >"+html1+"</td>";
	    			   			
				    	       var html2="";
				    	     if(data.buttonList!=null && data.buttonList.length!=0){
				    	      for(var i=0;i<data.buttonList.length;i++){
				    	    	  html2+=data.buttonList[i].name+"&nbsp;&nbsp;&nbsp;"+data.buttonList[i].counts+"次"+"<br/><br/>";
				    	      }
				    	     }
				    	      html+="<td>"+html2+"</td>";
				    	      
				    	      var html3="";
				    	      if(data.questionList !=null && data.questionList.length != 0){
				    	      for(var i=0;i<data.questionList.length;i++){
				    	    	  html3+=data.questionList[i].name+"&nbsp;&nbsp;&nbsp;"+data.questionList[i].counts+"次"+"<br/><br/>";
				    	      }
				    	      }
				    	      html=html+"<td>"+html3+"</td>";
				    	      
				    	      
				    	      
				    	      var html4="";
				    	      if(data.pageVisitList!=null && data.pageVisitList.length!=0){
				    	      for(var i=0;i<data.pageVisitList.length;i++){
				    	    	  html4+=data.pageVisitList[i].name+"&nbsp;&nbsp;&nbsp;"+data.pageVisitList[i].counts+"次"+"<br/><br/>";
				    	      }
				    	      }
				    	      html=html+"<td>"+html4+"</td>";
				    	      
				    	      var html5="";
				    	      if(data.sourceVisitList!=null && data.sourceVisitList.length!=0){
				    	      for(var i=0;i<data.sourceVisitList.length;i++){
				    	    	  html5+=data.sourceVisitList[i].name+"&nbsp;&nbsp;&nbsp;"+data.sourceVisitList[i].counts+"次"+"<br/><br/>";
				    	      }
				    	      }
				    	      html=html+"<td>"+html5+"</td>";
				    	      
				    	      
				    	      var start=new Date(data.startDate).format('yyyy-MM-dd');
				    	      var end=new Date(data.endDate).format('yyyy-MM-dd');
				    	      if(start == end){
				    	    	 html=html+"<td >"+new Date(data.startDate).format('yyyy-MM-dd')+"</td>";
				    	      }else{
				    	    	 html=html+"<td >"+new Date(data.startDate).format('yyyy-MM-dd')+"至"+"<br>"+new Date(data.endDate).format('yyyy-MM-dd')+"</td>";
				    	      }
				    	      $("#data").append(html);
				    	      
				    	      option1 = {
				    	    		    title : {
				    	    		        text: '按钮点击次数',
				    	    		        x:'center'
				    	    		    },
				    	    		    tooltip : {
				    	    		        trigger: 'item',
				    	    		        formatter: "{a} <br/>{b} : {c} ({d}%)"
				    	    		    },
				    	    		    grid : {
				    	    		    	width: '100%',
				    	    		    	height: '100%'
				    	    		    },
				    	    		    series : [
				    	    		        {
				    	    		           /*  name: '访问来源', */
				    	    		            type: 'pie',
				    	    		            radius : '55%',
				    	    		            center: ['50%', '60%'],
				    	    		            data:data1,
				    	    		            itemStyle: {
				    	    		                emphasis: {
				    	    		                    shadowBlur: 10,
				    	    		                    shadowOffsetX: 0,
				    	    		                    shadowColor: 'rgba(0, 0, 0, 0.5)'
				    	    		                }
				    	    		            }
				    	    		        }
				    	    		    ]
				    	    		};
				    	      
				    	      
				    	      option2 = {
				  	    		    title : {
				  	    		        text: '常见问题',
				  	    		        x:'center'
				  	    		    },
				  	    		    tooltip : {
				  	    		        trigger: 'item',
				  	    		        formatter: "{a} <br/>{b} : {c} ({d}%)"
				  	    		    },
				  	    		  	grid : {
			    	    		    	width: '100%',
			    	    		    	height: '100%'
			    	    		    },
				  	    		    series : [
				  	    		        {
				  	    		           /*  name: '访问来源', */
				  	    		            type: 'pie',
				  	    		            radius : '55%',
				  	    		            center: ['50%', '60%'],
				  	    		            data:data2,
				  	    		            itemStyle: {
				  	    		                emphasis: {
				  	    		                    shadowBlur: 10,
				  	    		                    shadowOffsetX: 0,
				  	    		                    shadowColor: 'rgba(0, 0, 0, 0.5)'
				  	    		                }
				  	    		            }
				  	    		        }
				  	    		    ]
				  	    		};
				    	      var divhtml="<div class='right' id='main1' style='float:left;width:50%;height:300px;left:0 auto'></div><div class='right' id='main2' style='float:left;width:50%;height:300px;left:0 auto'></div>";
					    	      $("#container2").append(divhtml);
					    	 if(data.buttonPie !=null && data.buttonPie.length !=0){
				    	      var myChart1 = echarts.init(document.getElementById('main1'));
			    	    	  myChart1.setOption(option1);
					    	 }
					    	 
					    	 if(data.questionPie !=null && data.questionPie.length !=0){
			    	    	  var myChart2 = echarts.init(document.getElementById('main2'));
			    	    	  myChart2.setOption(option2);
					    	 }
    	    			   }
    	    			});
    	    		});
    	    	  
    	    	  $("#query").on("click",function(){
    	    		  var chooseTimeQuery=$("#chooseTime").val();
    	    		  $.ajax({
     	    		   url: "${rc.contextPath}/robot/ajaxData",
     	    		   data: {
 	    				   province:"全国",
 	    				   chooseTime:chooseTimeQuery
 	    			   },
       	    		  	success: function(data){
       	    		  			var data1=data.buttonPie;
			    	      		var data2=data.questionPie;
       	    		  				$("#data").empty();
       	    		  			 	$("#container2").empty();
     	    			   			var html="<td>"+data.area+"</td>";
     	    			   			
     	    			   			var html1="";
     	    			   			if(data.askAnswerStat != null){
 					    	       		html1+=data.askAnswerStat.counts;
     	    			   			}
     	    			   			
     	    			   			html+="<td>"+html1+"</td>";
     	    			   			
 					    	       var html2="";
 					    	     if(data.buttonList!=null && data.buttonList.length!=0){
 					    	      for(var i=0;i<data.buttonList.length;i++){
 					    	    	  html2+=data.buttonList[i].name+"&nbsp;&nbsp;&nbsp;"+data.buttonList[i].counts+"次"+"<br/><br/>";
 					    	      }
 					    	     }
 					    	      html+="<td>"+html2+"</td>";
 					    	      
 					    	      var html3="";
 					    	      if(data.questionList !=null && data.questionList.length != 0){
 					    	      for(var i=0;i<data.questionList.length;i++){
 					    	    	  html3+=data.questionList[i].name+"&nbsp;&nbsp;&nbsp;"+data.questionList[i].counts+"次"+"<br/><br/>";
 					    	      }
 					    	      }
 					    	      html=html+"<td>"+html3+"</td>";
 					    	      var html4="";
 					    	      if(data.pageVisitList!=null && data.pageVisitList.length!=0){
 					    	      for(var i=0;i<data.pageVisitList.length;i++){
 					    	    	  html4+=data.pageVisitList[i].name+"&nbsp;&nbsp;&nbsp;"+data.pageVisitList[i].counts+"次"+"<br/><br/>";
 					    	      }
 					    	      }
 					    	      html=html+"<td>"+html4+"</td>";
 					    	      
 					    	      var html5="";
 					    	      if(data.sourceVisitList!=null && data.sourceVisitList.length!=0){
 					    	      for(var i=0;i<data.sourceVisitList.length;i++){
 					    	    	  html5+=data.sourceVisitList[i].name+"&nbsp;&nbsp;&nbsp;"+data.sourceVisitList[i].counts+"次"+"<br/><br/>";
 					    	      }
 					    	      }
 					    	      html=html+"<td>"+html5+"</td>";
 					    	      
 					    	      var start=new Date(data.startDate).format('yyyy-MM-dd');
 					    	      var end=new Date(data.endDate).format('yyyy-MM-dd');
 					    	      if(start == end){
 					    	    	 html=html+"<td>"+new Date(data.startDate).format('yyyy-MM-dd')+"</td>";
 					    	      }else{
 					    	    	 html=html+"<td>"+new Date(data.startDate).format('yyyy-MM-dd')+"至"+"<br>"+new Date(data.endDate).format('yyyy-MM-dd')+"</td>";
 					    	      }
 					    	      $("#data").append(html);
 					    	     
 					    	     option1 = {
					    	    		    title : {
					    	    		        text: '按钮点击次数',
					    	    		        x:'center'
					    	    		    },
					    	    		    tooltip : {
					    	    		        trigger: 'item',
					    	    		        formatter: "{b} : {c} ({d}%)"
					    	    		    },
					    	    		    grid : {
					    	    		    	width: '100%',
					    	    		    	height: '100%'
					    	    		    },
					    	    		    series : [
					    	    		        {
					    	    		           /*  name: '访问来源', */
					    	    		            type: 'pie',
					    	    		            radius : '55%',
					    	    		            center: ['50%', '60%'],
					    	    		            data:data1,
					    	    		            itemStyle: {
					    	    		                emphasis: {
					    	    		                    shadowBlur: 10,
					    	    		                    shadowOffsetX: 0,
					    	    		                    shadowColor: 'rgba(0, 0, 0, 0.5)'
					    	    		                }
					    	    		            }
					    	    		        }
					    	    		    ]
					    	    		};
					    	      
					    	      option2 = {
					  	    		    title : {
					  	    		        text: '常见问题',
					  	    		        x:'center'
					  	    		    },
					  	    		    tooltip : {
					  	    		        trigger: 'item',
					  	    		        formatter: "{b} : {c} ({d}%)"
					  	    		    },
					  	    		  	grid : {
				    	    		    	width: '100%',
				    	    		    	height: '100%'
				    	    		    },
					  	    		    series : [
					  	    		        {
					  	    		           /*  name: '访问来源', */
					  	    		            type: 'pie',
					  	    		            radius : '55%',
					  	    		            center: ['50%', '60%'],
					  	    		            data:data2,
					  	    		            itemStyle: {
					  	    		                emphasis: {
					  	    		                    shadowBlur: 10,
					  	    		                    shadowOffsetX: 0,
					  	    		                    shadowColor: 'rgba(0, 0, 0, 0.5)'
					  	    		                }
					  	    		            }
					  	    		        }
					  	    		    ]
					  	    		};
					    	      var divhtml="<div class='right' id='main1' style='float:left;width:50%;height:300px;left:0 auto'></div><div class='right' id='main2' style='float:left;width:50%;height:300px;left:0 auto'></div>";
						    	      $("#container2").append(divhtml);
						    	if(data.buttonPie !=null && data.buttonPie.length !=0){
					    	      var myChart1 = echarts.init(document.getElementById('main1'));
				    	    	  myChart1.setOption(option1);
						    	  }
				    	    	  if(data.questionPie !=null && data.questionPie.length !=0){
				    	    	  var myChart2 = echarts.init(document.getElementById('main2'));
				    	    	  myChart2.setOption(option2);
				    	    	  }
       	    		   		}
       	    			});
    	    	  });
    	      });
    	</script>
   </body>
</html>